home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- * *
- * $VER: Help 1.13 (28 Oct 1995)
- * *
- * Written by Freddy Ariës, with modifications by Robbie Akins *
- * *
- * Just a simple menu, for those who can't remember under which function *
- * key they have stored a certain function. *
- * *
- * This script will output a requester on the Scion window, in which it *
- * will display the current settings of Scion's function keys. *
- * It requires a version of Scion Genealogist >= 4.04. *
- * *
- * This script uses (by default) the rexxreqtools.library (which requires *
- * a version of reqtools larger than 2.0 and rexxsyslib.library) *
- * If you do not have these, run SetDefaults.rexx to change the settings. *
- * *
- * For this script to be of any use to you, you will have to add the *
- * Help.rexx command to the list of function keys that you have set in *
- * the ScionPrefs program (eg. under F1 or F10). *
- * *
- * DONE: *
- * - added "stripstring" option, and handling of long results *
- * (done by Robbie Akins) *
- * - enhanced stripstring options *
- * - now uses preference file for default settings *
- * *
- ****************************************************************************/
-
- options results
-
- versionstr = "1.13"
-
- /* Don't change the settings here! Run SetDefaults.rexx instead! */
- NL = '0A'x
- PSCR = 'SCIONGEN'
- usereq = 1
-
- scrdev = stdout; scrname = "CON:0//639//Scion Output/AUTO/SCREEN"
-
- /* stripstring: 1 = strip directory path from string, 0 = don't strip */
- /* Feel free to change _these_ settings to your own liking */
- stripstring.1 = 1
- stripstring.2 = 1
- stripstring.3 = 1
- stripstring.4 = 1
- stripstring.5 = 1
- stripstring.6 = 1
- stripstring.7 = 1
- stripstring.8 = 1
- stripstring.9 = 1
- stripstring.10 = 1
-
- /* read preferences file */
-
- if open(pfile, 'ENV:Scion/ScionRexx.prefs', 'r') then do
- do while ~eof(pfile)
- inln = readln(pfile)
- if inln ~= "" then do
- wstr = upper(word(inln, 1))
- if wstr = "USEREQ" then
- usereq = 1
- else if wstr = "NOUSEREQ" then
- usereq = 0
- else if wstr = "PUBSCREEN" then
- pscr = strip(delstr(inln, 1, length(wstr)), 'b', ' "')
- end
- end
- close(pfile)
- end
-
- if pscr = "" | (pscr ~= "WORKBENCH" & ~show('p', pscr)) then
- pscr = "SCIONGEN"
- scrname = scrname||pscr
-
- if ~show('l','rexxarplib.library') then do
- if exists('libs:rexxarplib.library') then
- call addlib('rexxarplib.library',0,-30,0)
- end
-
- screentofront(pscr)
-
- if ~show('l','rexxreqtools.library') then do
- if exists('libs:rexxreqtools.library') then
- call addlib('rexxreqtools.library',0,-30,0)
- else do
- Tell("Unable to open rexxreqtools.library")
- EXIT
- end
- end
-
- /* Originally stolen from Peter Billing - thanks Peter ;-) */
- if ~show('P','SCIONGEN') then do
- EndString('I am sorry to say that the SCION Genealogist' || NL ||,
- 'database is not available. Please start the' || NL ||,
- 'SCION program BEFORE using this script!')
- end
-
- myport = "SCIONGEN"
- address value myport
-
- /*
- * Now let's get funky... (get the current function key settings) ;-)
- */
-
- do i=1 to 10
- GETFUNKEY i
- fun.i = TruncString(StripPath(RESULT, i))
- end
-
- if usereq then do
- rtn = rtezrequest('Current Scion Function Keys: '||NL||,
- NL||' F1 = '||fun.1||,
- NL||' F2 = '||fun.2||,
- NL||' F3 = '||fun.3||,
- NL||' F4 = '||fun.4||,
- NL||' F5 = '||fun.5||,
- NL||' F6 = '||fun.6||,
- NL||' F7 = '||fun.7||,
- NL||' F8 = '||fun.8||,
- NL||' F9 = '||fun.9||,
- NL||' F10 = '||fun.10||,
- '','_Ok','Help v'||versionstr||' by F.Ariës & R.Akins','rt_pubscrname = '||PSCR)
- end
- else do
- if pscr ~= "WORKBENCH" then do
- scrdev = 'SCNHLPSCR'
- if ~open(scrdev, scrname, 'w') then scrdev = stdout
- end
- Tell('*** Help v'||versionstr||' by F. Ariës & R. Akins ***')
- Tell(' Current Scion Function Keys: ')
- Tell(' F1 = '||fun.1)
- Tell(' F2 = '||fun.2)
- Tell(' F3 = '||fun.3)
- Tell(' F4 = '||fun.4)
- Tell(' F5 = '||fun.5)
- Tell(' F6 = '||fun.6)
- Tell(' F7 = '||fun.7)
- Tell(' F8 = '||fun.8)
- Tell(' F9 = '||fun.9)
- Tell(' F10 = '||fun.10)
- if scrdev ~= stdout then do
- Tell(NL||"Press <return> to exit.")
- readln(scrdev)
- close(scrdev)
- end
- end
-
- EXIT
-
- EndString: PROCEDURE EXPOSE usereq pscr scrdev
- parse arg str
- if usereq then
- rtezrequest(str,'E_xit','Help Message:','rt_pubscrname = '||pscr)
- else
- Tell("ERROR: "||str)
- EXIT
-
- /*
- * Procedure to strip the directory path from the string.
- * It will cut off the entire left part of the string, until (and including)
- * the path name, only leaving the filename.
- * If you don't want the path to be left off, use the stripstring flags
- */
- StripPath: PROCEDURE EXPOSE stripstring.
- parse arg str, ix
- if stripstring.ix then /* test by Robbie Akins */
- do
- p = lastpos('/', str)
- if p > 0 then ret1 = delstr(str,1,p)
- else ret1 = str
- p = lastpos(':', ret1)
- if p > 0 then retstr = delstr(ret1,1,p)
- else retstr = ret1
- end
- else
- retstr = str
- return retstr
-
- /*
- * Procedure to truncate long strings and add ellipsis (...) at the end
- * Written by Robbie Akins
- */
- TruncString: PROCEDURE
- parse arg trstr
- if length(trstr) > 60 then
- rtnstr = trim(left(trstr, 60))||"..."
- else
- rtnstr = trstr
- return rtnstr
-
- Tell: PROCEDURE EXPOSE scrdev
- parse arg str
- writeln(scrdev, str)
- return 0
-